package com.zl.codereview.git.model;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * review文件
 */
public class ReviewProjectFile implements Serializable {

    private String fileId;

    /**
     * 文件路径
     */
    private String path;

    /**
     * resp 名称
     */
    private String name;

    /**
     * 文件名称
     */
    private String fileName;

    /**
     * 是否是文件，否则目录
     */
    private boolean fileFlag;

    /**
     * 文件创作作者
     */
    private List<GitAuthor> authors = new ArrayList<>();

    /**
     * 文件代码对象
     */
    private List<ProjectFileCode> codes = new ArrayList<>();

    /**
     * 下级文件
     */
    private List<ReviewProjectFile> files = new ArrayList<>();

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public boolean isFileFlag() {
        return fileFlag;
    }

    public void setFileFlag(boolean fileFlag) {
        this.fileFlag = fileFlag;
    }

    public List<GitAuthor> getAuthors() {
        return authors;
    }

    public void setAuthors(List<GitAuthor> authors) {
        this.authors = authors;
    }

    public List<ProjectFileCode> getCodes() {
        return codes;
    }

    public void setCodes(List<ProjectFileCode> codes) {
        this.codes = codes;
    }

    public List<ReviewProjectFile> getFiles() {
        return files;
    }

    public void setFiles(List<ReviewProjectFile> files) {
        this.files = files;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ReviewProjectFile that = (ReviewProjectFile) o;
        return Objects.equals(fileId, that.fileId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileId);
    }
}
